package uy.edu.fing.signeo.configuracion;

import es.unex.sextante.core.GeoAlgorithm;
import es.unex.sextante.core.Sextante;
import es.unex.sextante.dataObjects.IRasterLayer;
import es.unex.sextante.rasterWrappers.GridExtent;

public class Raster1BandaAlgorithm extends GeoAlgorithm{
	
	protected double m_dValue;
	public static final String RESULT = "RESULT";
	protected final double NO_DATA = -99999.0;
	
    public void defineCharacteristics(){
    	
     	this.setGroup(Sextante.getText("Incendios"));
 		this.setName(Sextante.getText(new String("Prueba Raster 1 Banda")));
 		setGeneratesUserDefinedRasterOutput(false);
 		
		addOutputRasterLayer(RESULT, "Raster de 1 banda");

    }
    
    public boolean processAlgorithm() {
    	try {
    		
    		GridExtent gridExtent = new GridExtent();
    		gridExtent.setCellSize(1);
    		gridExtent.setXRange(0, 2);
    		gridExtent.setYRange(0, 2);
    		
    		IRasterLayer result = getNewRasterLayer(RESULT, "Raster de 1 banda", IRasterLayer.RASTER_DATA_TYPE_DOUBLE, gridExtent, 1);
    		
    		//BANDA 0 (Indice)
    		result.setCellValue(0, 0, 0, 1);
    		result.setCellValue(1, 0, 0, 2);
    		result.setCellValue(0, 1, 0, 3);
    		result.setCellValue(1, 1, 0, 4);
    		
    		
    		
    		return !m_Task.isCanceled();
    		
    	}catch (Exception e) {
    		e.printStackTrace();
    	}	

    	return !m_Task.isCanceled();

    }
    

}
    


	